package com.framework.file.model;

import com.framework.common.listener.impl.BaseEntityUpdate;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;


/**
 * @description: 档案管理 model
 * @author: lizurong
 * @version: 1.0
 * @date: 2021-04-01 16:53:14
 */
@Data
@Entity
@Table(name = "sys_filemanage")
@org.hibernate.annotations.Table(appliesTo = "sys_filemanage", comment = "档案管理")
public class FileManage extends BaseEntityUpdate {

    @Column(nullable = false, columnDefinition = "varchar(32) COMMENT 'pid' ")
    private String pid;

    @Column(columnDefinition = "int(2) COMMENT '树深度' ")
    private Integer treeLevel;

    @Column(columnDefinition = "varchar(32) COMMENT '文件夹名' ")
    private String folderName;

    @Column(columnDefinition = "varchar(32) COMMENT '归档文件' ")
    private String fileId;

    @Column(columnDefinition = "varchar(32) COMMENT '保管期限' ")
    private String savePeriod;

    @Column(columnDefinition = "int(2) COMMENT '是否工程竣工档案(1是2否)' ")
    private Integer isComplete;

    @Column(columnDefinition = "varchar(32) COMMENT '文件描述' ")
    private String description;

    @Column(columnDefinition = "int(2) COMMENT '来源(1自动归档2档案补录)' ")
    private Integer source;

    @Column(columnDefinition = "varchar(255) COMMENT '纸质位置' ")
    private String paperLocation;

    @Column(columnDefinition = "varchar(32) COMMENT '标签' ")
    private String tag;

    //归档人
    @Transient
    private String createrName;

    @Transient
    private SysFile file;

    @Transient
    private List<FileManage> children;

    public FileManage() {
    }

    public FileManage(String pid,Integer treeLevel, String folderName, String savePeriod, Integer isComplete, String description, Integer source, String paperLocation, String tag) {
        this.pid = pid;
        this.treeLevel=treeLevel;
        this.folderName = folderName;
        this.savePeriod = savePeriod;
        this.isComplete = isComplete;
        this.description = description;
        this.source = source;
        this.paperLocation = paperLocation;
        this.tag = tag;
    }
}
